home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / hack / 3_1_3 / sys / msdos / trampoli.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-20  |  14.5 KB  |  641 lines

  1. /*    SCCS Id: @(#)trampoli.c     3.1    93/01/18      */
  2. /* Copyright (c) 1989 - 1993 by Norm Meluch and Stephen Spackman  */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #include "hack.h"
  6.  
  7. /****************************************************************************/
  8. /*                                        */
  9. /*    This file contains a series of definitions of "one liner"        */
  10. /*    functions corresponding to *all* functions that NetHack calls        */
  11. /*    via pointers.                                */
  12. /*         IF ANY CALLS TO FUNCTIONS VIA POINTERS ARE ADDED            */
  13. /*         TO THE CODE, AN ENTRY FOR THE FUNCTION CALLED MUST            */
  14. /*         BE ADDED TO THIS FILE AND TO TRAMPOLI.H.                */
  15. /*    This mess is necessary for the Microsoft Compiler implementation    */
  16. /*    of overlaid code (v5.1 - 6.0ax).                    */
  17. /*                                        */
  18. /*    The original function (eg foo) has been #defined to be foo_        */
  19. /*    via double inclusion of trampoli.h in hack.h, and            */
  20. /*    now the definition of foo is placed in this file calling foo        */
  21. /*    directly.  This module is _never_ placed in an overlay so        */
  22. /*    calls via pointers to these functions will not cause difficulties.  */
  23. /*                                        */
  24. /*    This leads to what could be called a "trampoline" effect, and        */
  25. /*    hence the silly name for these files. :-)                */
  26. /*                                        */
  27. /****************************************************************************/
  28.  
  29. #ifdef OVERLAY
  30.  
  31. /* ### apply.c ### */
  32. #undef dig
  33. #undef doapply
  34. #undef dojump
  35. #undef dorub
  36.  
  37. int dig()        { return dig_(); }
  38. int doapply()        { return doapply_(); }
  39. int dojump()        { return dojump_(); }
  40. int dorub()        { return dorub_(); }
  41.  
  42.  
  43. /* ### artifact.c ### */
  44. #undef doinvoke
  45.  
  46. int doinvoke()        { return doinvoke_(); }
  47.  
  48.  
  49. /* ### cmd.c ### */
  50. #undef doextcmd
  51. #undef doextlist
  52. #undef doprev_message
  53.  
  54. #ifdef POLYSELF
  55. #undef domonability
  56. #endif /* POLYSELF */
  57.  
  58. #ifdef EXPLORE_MODE
  59. #undef enter_explore_mode
  60.  
  61. int enter_explore_mode()    { return enter_explore_mode_(); }
  62. #endif
  63.  
  64. #undef timed_occupation
  65.  
  66. #if defined(WIZARD) || defined(EXPLORE_MODE)
  67. #undef wiz_attributes
  68. #endif
  69.  
  70. #ifdef WIZARD
  71. #undef wiz_detect
  72. #undef wiz_genesis
  73. #undef wiz_identify
  74. #undef wiz_level_tele
  75. #undef wiz_map
  76. #undef wiz_where
  77. #undef wiz_wish
  78. #endif
  79.  
  80. int doextcmd()        { return doextcmd_(); }
  81. int doextlist()        { return doextlist_(); }
  82. int doprev_message()    { return doprev_message_(); }
  83.  
  84. #ifdef POLYSELF
  85. int domonability()    { return domonability_(); }
  86. #endif /* POLYSELF */
  87.  
  88. int timed_occupation()    { return timed_occupation_(); }
  89.  
  90. #if defined(WIZARD) || defined(EXPLORE_MODE)
  91. int wiz_attributes()    { return wiz_attributes_(); }
  92. #endif
  93.  
  94. #ifdef WIZARD
  95. int wiz_detect()    { return wiz_detect_(); }
  96. int wiz_genesis()    { return wiz_genesis_(); }
  97. int wiz_identify()    { return wiz_identify_(); }
  98. int wiz_level_tele()    { return wiz_level_tele_(); }
  99. int wiz_map()        { return wiz_map_(); }
  100. int wiz_where()        { return wiz_where_(); }
  101. int wiz_wish()        { return wiz_wish_(); }
  102. #endif
  103.  
  104.  
  105. /* ### do.c ### */
  106. #undef doddrop
  107. #undef dodown
  108. #undef dodrop
  109. #undef donull
  110. #undef doup
  111. #undef dowipe
  112. #undef drop
  113. #undef wipeoff
  114.  
  115. int doddrop()            { return doddrop_(); }
  116. int dodown()            { return dodown_(); }
  117. int dodrop()            { return dodrop_(); }
  118. int donull()            { return donull_(); }
  119. int doup()            { return doup_(); }
  120. int dowipe()            { return dowipe_(); }
  121. int drop(obj)
  122.   register struct obj *obj;    { return drop_(obj); }
  123. int wipeoff()            { return wipeoff_(); }
  124.  
  125.  
  126. /* ### do_name.c ### */
  127. #undef ddocall
  128. #undef do_mname
  129.  
  130. int ddocall()        { return ddocall_(); }
  131. int do_mname()        { return do_mname_(); }
  132.  
  133.  
  134. /* ### do_wear.c ### */
  135. #undef Armor_off
  136. #undef Boots_off
  137. #undef Gloves_off
  138. #undef Helmet_off
  139. #undef Armor_on
  140. #undef Boots_on
  141. #undef Gloves_on
  142. #undef Helmet_on
  143. #undef doddoremarm
  144. #undef doputon
  145. #undef doremring
  146. #undef dotakeoff
  147. #undef dowear
  148. #undef select_off
  149. #undef take_off
  150.  
  151. int Armor_off()        { return Armor_off_(); }
  152. int Boots_off()        { return Boots_off_(); }
  153. int Gloves_off()    { return Gloves_off_(); }
  154. int Helmet_off()    { return Helmet_off_(); }
  155. int Armor_on()        { return Armor_on_(); }
  156. int Boots_on()        { return Boots_on_(); }
  157. int Gloves_on()        { return Gloves_on_(); }
  158. int Helmet_on()        { return Helmet_on_(); }
  159. int doddoremarm()    { return doddoremarm_(); }
  160. int doputon()        { return doputon_(); }
  161. int doremring()        { return doremring_(); }
  162. int dotakeoff()        { return dotakeoff_(); }
  163. int dowear()        { return dowear_(); }
  164. int select_off(otmp)
  165.   struct obj *otmp;    { return select_off_(otmp); }
  166. int take_off()        { return take_off_(); }
  167.  
  168.  
  169. /* ### dogmove.c ### */
  170. #undef wantdoor
  171.  
  172. void wantdoor(x, y, dummy)
  173.   int x, y; genericptr_t dummy; { wantdoor_(x, y, dummy); }
  174.  
  175.  
  176. /* ### dokick.c ### */
  177. #undef dokick
  178.  
  179. int dokick()        { return dokick_(); }
  180.  
  181.  
  182. /* ### dothrow.c ### */
  183. #undef dothrow
  184.  
  185. int dothrow()        { return dothrow_(); }
  186.  
  187.  
  188. /* ### eat.c ### */
  189. #undef Hear_again
  190. #undef eatmdone
  191. #undef doeat
  192. #undef eatfood
  193. #undef opentin
  194. #undef unfaint
  195.  
  196. int Hear_again()    { return Hear_again_(); }
  197. int eatmdone()        { return eatmdone_(); }
  198. int doeat()        { return doeat_(); }
  199. int eatfood()        { return eatfood_(); }
  200. int opentin()        { return opentin_(); }
  201. int unfaint()        { return unfaint_(); }
  202.  
  203.  
  204. /* ### end.c ### */
  205. #undef done1
  206. #undef done2
  207. #undef hangup
  208. #undef done_intr
  209.  
  210. #if defined(UNIX) || defined(VMS)
  211. #undef done_hangup
  212. #endif /* UNIX || VMS */
  213.  
  214. int done1()        { return done1_(); }
  215. int done2()        { return done2_(); }
  216. int hangup()        { return hangup_(); }
  217. int done_intr()        { return done_intr_(); }
  218.  
  219. #if defined(UNIX) || defined(VMS)
  220. int done_hangup()    { return done_hangup_(); }
  221. #endif /* UNIX || VMS */
  222.  
  223.  
  224. /* ### engrave.c ### */
  225. #undef doengrave
  226.  
  227. int doengrave()        { return doengrave_(); }
  228.  
  229.  
  230. /* ### fountain.c ### */
  231. #undef gush
  232.  
  233. void gush(x, y, poolcnt)
  234.   int x, y; genericptr_t poolcnt; { gush_(x, y, poolcnt); }
  235.  
  236.  
  237. /* ### hack.c ### */
  238. #undef dopickup
  239. #undef identify
  240.  
  241. int dopickup()        { return dopickup_(); }
  242. int identify(otmp)
  243.   struct obj *otmp;    { return identify_(otmp); }
  244.  
  245.  
  246. /* ### invent.c ### */
  247. #undef ckunpaid
  248. #undef ddoinv
  249. #undef dolook
  250. #undef dopramulet
  251. #undef doprarm
  252. #undef doprgold
  253. #undef doprring
  254. #undef doprtool
  255. #undef doprwep
  256. #undef dotypeinv
  257. #undef doorganize
  258.  
  259. int ckunpaid(obj)
  260.   struct obj *obj;    { return ckunpaid_(obj); }
  261. int ddoinv()        { return ddoinv_(); }
  262. int dolook()        { return dolook_(); }
  263. int dopramulet()    { return dopramulet_(); }
  264. int doprarm()        { return doprarm_(); }
  265. int doprgold()        { return doprgold_(); }
  266. int doprring()        { return doprring_(); }
  267. int doprtool()        { return doprtool_(); }
  268. int doprwep()        { return doprwep_(); }
  269. int dotypeinv()        { return dotypeinv_(); }
  270. int doorganize()    { return doorganize_(); }
  271.  
  272.  
  273. /* ### ioctl.c ### */
  274. #ifdef UNIX
  275. # ifdef SUSPEND
  276. #undef dosuspend
  277.  
  278. int dosuspend()        { return dosuspend_(); }
  279. # endif /* SUSPEND */
  280. #endif /* UNIX */
  281.  
  282.  
  283. /* ### lock.c ### */
  284. #undef doclose
  285. #undef doforce
  286. #undef doopen
  287. #undef forcelock
  288. #undef picklock
  289.  
  290. int doclose()        { return doclose_(); }
  291. int doforce()        { return doforce_(); }
  292. int doopen()        { return doopen_(); }
  293. int forcelock()        { return forcelock_(); }
  294. int picklock()        { return picklock_(); }
  295.  
  296.  
  297. /* ### mklev.c ### */
  298. #undef do_comp
  299.  
  300. int do_comp(vx, vy)
  301.   genericptr_t vx, vy;    { return comp_(vx, vy); }
  302.  
  303.  
  304. /* ### mondata.c ### */
  305. /* canseemon() is only called by a macro e_boolean.  If e_boolean ever does
  306.    become a function, this may need to return. */
  307.  
  308. /* #undef canseemon */
  309.  
  310. /* boolean canseemon(x) struct monst *x; { return canseemon_(x); } */
  311.  
  312.  
  313. /* ### muse.c ### */
  314. #undef mbhitm
  315.  
  316. int mbhitm(mtmp, otmp)
  317.   struct monst *mtmp; struct obj *otmp; { return mbhitm_(mtmp, otmp); }
  318.  
  319.  
  320. /* ### o_init.c ### */
  321. #undef dodiscovered
  322.  
  323. int dodiscovered()    { return dodiscovered_(); }
  324.  
  325.  
  326. /* ### objnam.c ### */
  327. #undef doname
  328. #undef xname
  329.  
  330. char *doname(obj)
  331.   struct obj *obj;    { return doname_(obj); }
  332. char *xname(obj)
  333.   struct obj *obj;    { return xname_(obj); }
  334.  
  335.  
  336. /* ### options.c ### */
  337. #undef doset
  338. #undef dotogglepickup
  339.  
  340. int doset()        { return doset_(); }
  341. int dotogglepickup()    { return dotogglepickup_(); }
  342.  
  343.  
  344. /* ### pager.c ### */
  345. #undef dohelp
  346. #undef dohistory
  347. #undef dowhatdoes
  348. #undef dowhatis
  349. #undef doquickwhatis
  350.  
  351. int dohelp()        { return dohelp_(); }
  352. int dohistory()        { return dohistory_(); }
  353. int dowhatdoes()    { return dowhatdoes_(); }
  354. int dowhatis()        { return dowhatis_(); }
  355. int doquickwhatis()    { return doquickwhatis_(); }
  356.  
  357.  
  358. /* ### pcsys.c ### */
  359. #ifdef SHELL
  360. #undef dosh
  361.  
  362. int dosh()        { return dosh_(); }
  363. #endif /* SHELL */
  364.  
  365.  
  366. /* ### pickup.c ### */
  367. #undef ck_bag
  368. #undef doloot
  369. #undef in_container
  370. #undef out_container
  371.  
  372. int ck_bag(obj)
  373.   struct obj *obj;    { return ck_bag_(obj);  }
  374. int doloot()        { return doloot_(); }
  375. int in_container(obj)
  376.   struct obj *obj;    { return in_container_(obj); }
  377. int out_container(obj)
  378.   struct obj *obj;    { return out_container_(obj); }
  379.  
  380.  
  381. /* ### potion.c ### */
  382. #undef dodrink
  383. #undef dodip
  384.  
  385. int dodrink()        { return dodrink_(); }
  386. int dodip()        { return dodip_(); }
  387.  
  388.  
  389. /* ### pray.c ### */
  390. #undef doturn
  391. #undef dopray
  392. #undef prayer_done
  393. #undef dosacrifice
  394.  
  395. int doturn()        { return doturn_(); }
  396. int dopray()        { return dopray_(); }
  397. int prayer_done()    { return prayer_done_(); }
  398. int dosacrifice()    { return dosacrifice_(); }
  399.  
  400.  
  401. /* ### print.c ### */
  402. #undef doredraw
  403.  
  404. int doredraw()        { return doredraw_(); }
  405.  
  406.  
  407. /* ### read.c ### */
  408. #undef doread
  409. #undef set_lit
  410.  
  411. int doread()        { return doread_(); }
  412. void set_lit(x, y, val)
  413.   int x, y; genericptr_t val; { set_lit_(x, y, val); }
  414.  
  415.  
  416. /* ### rip.c ### */
  417. #undef genl_outrip
  418.  
  419. void genl_outrip(tmpwin, how)
  420.   winid tmpwin; int how; { genl_outrip_(tmpwin, how); }
  421.  
  422.  
  423. /* ### save.c ### */
  424. #undef dosave
  425.  
  426. int dosave()        { return dosave_(); }
  427.  
  428.  
  429. /* ### search.c ### */
  430. #undef findone
  431. #undef openone
  432. #undef doidtrap
  433. #undef dosearch
  434.  
  435. void findone(zx, zy, num)
  436.   int zx, zy; genericptr_t num; { findone_(zx, zy, num); }
  437. void openone(zx, zy, num)
  438.   int zx, zy; genericptr_t num; { openone_(zx, zy, num); }
  439. int doidtrap()        { return doidtrap_(); }
  440. int dosearch()        { return dosearch_(); }
  441.  
  442.  
  443. /* ### shk.c ### */
  444. #undef dopay
  445.  
  446. int dopay()        { return dopay_(); }
  447.  
  448.  
  449. /* ### sit.c ### */
  450. #undef dosit
  451.  
  452. int dosit()        { return dosit_(); }
  453.  
  454.  
  455. /* ### sounds.c ### */
  456. #undef dotalk
  457.  
  458. int dotalk()        { return dotalk_(); }
  459.  
  460.  
  461. /* ### spell.c ### */
  462. #undef learn
  463. #undef docast
  464. #undef dovspell
  465.  
  466. int learn()        { return learn_(); }
  467. int docast()        { return docast_(); }
  468. int dovspell()        { return dovspell_(); }
  469.  
  470.  
  471. /* ### steal.c ### */
  472. #undef stealarm
  473.  
  474. int stealarm()        { return stealarm_(); }
  475.  
  476.  
  477. /* ### trap.c ### */
  478. #undef dotele
  479. #undef dountrap
  480. #undef float_down
  481.  
  482. int dotele()        { return dotele_(); }
  483. int dountrap()        { return dountrap_(); }
  484. int float_down()    { return float_down_(); }
  485.  
  486.  
  487. /* ### version.c ### */
  488. #undef doversion
  489. #undef doextversion
  490.  
  491. int doversion()        { return doversion_(); }
  492. int doextversion()    { return doextversion_(); }
  493.  
  494.  
  495. /* ### wield.c ### */
  496. #undef dowield
  497.  
  498. int dowield()        { return dowield_(); }
  499.  
  500.  
  501. /* ### zap.c ### */
  502. #undef bhitm
  503. #undef bhito
  504. #undef dozap
  505.  
  506. int bhitm(mtmp, otmp)
  507.   struct monst *mtmp; struct obj *otmp; { return bhitm_(mtmp, otmp); }
  508. int bhito(obj, otmp)
  509.   struct obj *obj, *otmp; { return bhito_(obj,  otmp); }
  510. int dozap()        { return dozap_(); }
  511.  
  512.  
  513. /*
  514.  * Window Implementation Specific Functions.
  515.  */
  516.  
  517. /* ### getline.c ### */
  518. #undef tty_getlin
  519. #ifdef COM_COMPL
  520. #undef tty_get_ext_cmd
  521.  
  522. void tty_get_ext_cmd(bufp)
  523.   char *bufp;            { tty_get_ext_cmd_(bufp); }
  524. #endif /* COM_COMPL */
  525. void tty_getlin(query,bufp)
  526.   const char *query; char *bufp;{ tty_getlin_(query,bufp); }
  527.  
  528.  
  529. /* ### termcap.c ### */
  530. #undef tty_nhbell
  531. #undef tty_number_pad
  532. #undef tty_delay_output
  533. #undef tty_start_screen
  534. #undef tty_end_screen
  535.  
  536. void tty_nhbell()        { tty_nhbell_(); }
  537. void tty_number_pad(state)
  538.   int state;            { tty_number_pad_(state); }
  539. void tty_delay_output()        { tty_delay_output_(); }
  540. /* other defs that really should go away (they're tty specific) */
  541. void tty_start_screen()        { tty_start_screen_(); }
  542. void tty_end_screen()        { tty_end_screen_(); }
  543.  
  544.  
  545. /* ### topl.c ### */
  546. #undef tty_doprev_message
  547. #undef tty_yn_function
  548.  
  549. int tty_doprev_message()    { return tty_doprev_message_(); }
  550. char tty_yn_function(query,resp,def)
  551.   const char *query, *resp; char def;
  552.                 { return tty_yn_function_(query,resp,def); }
  553.  
  554.  
  555. /* ### wintty.c ### */
  556. #undef tty_init_nhwindows
  557. #undef tty_player_selection
  558. #undef tty_askname
  559. #undef tty_get_nh_event
  560. #undef tty_exit_nhwindows
  561. #undef tty_suspend_nhwindows
  562. #undef tty_resume_nhwindows
  563. #undef tty_create_nhwindow
  564. #undef tty_clear_nhwindow
  565. #undef tty_display_nhwindow
  566. #undef tty_destroy_nhwindow
  567. #undef tty_curs
  568. #undef tty_putstr
  569. #undef tty_display_file
  570. #undef tty_start_menu
  571. #undef tty_add_menu
  572. #undef tty_end_menu
  573. #undef tty_select_menu
  574. #undef tty_update_inventory
  575. #undef tty_mark_synch
  576. #undef tty_wait_synch
  577. #ifdef CLIPPING
  578. #undef tty_cliparound
  579. #endif
  580. #undef tty_print_glyph
  581. #undef tty_raw_print
  582. #undef tty_raw_print_bold
  583. #undef tty_nhgetch
  584. #undef tty_nh_poskey
  585.  
  586. void tty_init_nhwindows()    { tty_init_nhwindows_(); }
  587. void tty_player_selection()    { tty_player_selection_(); }
  588. void tty_askname()        { tty_askname_(); }
  589. void tty_get_nh_event()        { tty_get_nh_event_(); }
  590. void tty_exit_nhwindows(str)
  591.   const char *str;        { tty_exit_nhwindows_(str); }
  592. void tty_suspend_nhwindows(str)
  593.   const char *str;        { tty_suspend_nhwindows_(str); }
  594. void tty_resume_nhwindows()    { tty_resume_nhwindows_(); }
  595. winid tty_create_nhwindow(type)
  596.   int type;            { return tty_create_nhwindow_(type); }
  597. void tty_clear_nhwindow(window)
  598.   winid window;            { tty_clear_nhwindow_(window); }
  599. void tty_display_nhwindow(window, blocking)
  600.   winid window; boolean blocking;
  601.                 { tty_display_nhwindow_(window,blocking); }
  602. void tty_destroy_nhwindow(window)
  603.   winid window;            { tty_destroy_nhwindow_(window); }
  604. void tty_curs(window,x,y)
  605.   winid window; int x,y;    { tty_curs_(window,x,y); }
  606. void tty_putstr(window,attr,str)
  607.   winid window; int attr; const char *str;
  608.                 { tty_putstr_(window,attr,str); }
  609. void tty_display_file(fname, complain)
  610.   const char *fname; boolean complain;
  611.                 { tty_display_file_(fname,complain); }
  612. void tty_start_menu(window)
  613.   winid window;            { tty_start_menu_(window); }
  614. void tty_add_menu(window,ch,attr,str)
  615.   winid window; char ch; int attr; const char *str;
  616.                 { tty_add_menu_(window,ch,attr,str); }
  617. void tty_end_menu(window,ch,str,morestr)
  618.   winid window; char ch; const char *str, *morestr;
  619.                 { tty_end_menu_(window,ch,str,morestr); }
  620. char tty_select_menu(window)
  621.   winid window;            { return tty_select_menu_(window); }
  622. void tty_update_inventory()    { tty_update_inventory_(); }
  623. void tty_mark_synch()        { tty_mark_synch_(); }
  624. void tty_wait_synch()        { tty_wait_synch_(); }
  625. #ifdef CLIPPING
  626. void tty_cliparound(x,y)
  627.   int x,y;            { tty_cliparound_(x,y); }
  628. #endif
  629. void tty_print_glyph(window,x,y,glyph)
  630.   winid window; xchar x,y; int glyph;
  631.                 { tty_print_glyph_(window,x,y,glyph); }
  632. void tty_raw_print(str)
  633.   const char *str;        { tty_raw_print_(str); }
  634. void tty_raw_print_bold(str)
  635.   const char *str;        { tty_raw_print_bold_(str); }
  636. int tty_nhgetch()        { return tty_nhgetch_(); }
  637. int tty_nh_poskey(x,y,pos)
  638.   int *x,*y,*pos;        { return tty_nh_poskey_(x,y,pos); }
  639.  
  640. #endif /* OVERLAY */
  641.